import Guide from '~/components/layout/guide'
import Snippet from '~/components/snippet'
import { Image } from '~/components/media'
import Caption from '~/components/text/caption'
import Note from '~/components/text/note'

export const meta = {
  title: 'Transferring Domains to ZEIT Now',
  description: 'How to transfer your domain to ZEIT Now.',
  published: '2019-10-11T17:00:00.860Z',
  authors: ['msweeneydev'],
  url: '/guides/transferring-domains-to-zeit-now',
  editUrl: 'pages/guides/transferring-domains-to-zeit-now.mdx',
  lastEdited: '2019-11-06T15:33:04.000Z'
}

With ZEIT Now, you can [assign a custom domain](/docs/v2/custom-domains#adding-a-domain) to any of your projects. If you want to transfer your domain in from an external registrar to ZEIT, you can do that painlessly without worrying about domain and DNS configuration.

This guide will walk you through how to transfer your domain to ZEIT in a few steps.

## Step 1: Unlock Your Domain

To transfer your domain, the first step is to unlock your domain from your registrar's domain management area. Most domains are usually locked by default to prevent unauthorized changes.

<Image
  src={`https://assets.zeit.co/image/upload/front/blog/announcing-transfer-in-for-domains/godaddy.png`}
  width={2206/2}
  height={1518/2}
/>
<Caption>Unlocking a domain on GoDaddy.</Caption>

The domain lock feature appears in different forms across registrars. Sign into the host where your domain is registered and look for a `Domain Lock` or similar option to unlock your domain.

After unlocking, **request an authorization code**. The code will be sent to the email address associated with your domain by your registrar. In some cases, your authorization code simply pops up on your dashboard.

<Note>
  {' '}
  A domain can't be transferred to another registrar within 60 days of the date
  they were registered or transferred to a new registrar.{' '}
</Note>

## Step 2: Transfer In Your Domain

When transferring a domain, you will have two options to choose from. Either using the [ZEIT Dashboard](https://zeit.co/dashboard/domains) or [Now CLI](/download).

### Option 1: Using ZEIT Dashboard

Using the [ZEIT Dashboard](https://zeit.co/dashboard/domains), you can perform a domain transfer by entering the domain you want to transfer in, and the respective authorization code from the domain registrar via the UI like so:

<Image
  src={`https://assets.zeit.co/image/upload/front/blog/announcing-transfer-in-for-domains/dashboard.png`}
  width={2206/2}
  height={1518/2}
/>
<Caption>Transferring in a Domain via the ZEIT Dashboard.</Caption>

### Option 2: Using Now CLI

With [Now CLI](/download), you can run the following command from your terminal.

<Snippet dark text="now domains transfer-in [your-domain]" />
<Caption>Transferring in a Domain via Now CLI.</Caption>

You will be requested to provide an authorization code from your registrar after running this command. Once you get the authorization code from your registrar, paste it into the prompt and the transfer will begin.

<Note>
  In a case where your domain cannot be transferred, check if it's not up to 60
  days since the domain has been registered, or if the domain had previously
  been transferred within the past 60 days. If none of that checks out, contact
  your registrar.
</Note>

## DNS Transfer

After activating a domain `transfer-in`, you will be informed that the DNS settings for your domain will not be transferred along with the domain. Instead, you will need to download a zone file from your registrar and upload it to ZEIT.

You can import the zone file to ZEIT DNS by running the following command:

<Snippet dark text="now dns import [your-domain] [zonefile]" />
<Caption>Importing a DNS zone file with Now CLI.</Caption>

<Note>
  If you do not apply a custom zone file, transferring in a domain automatically
  applies the default ZEIT DNS settings.
</Note>

## Deploying with the Domain

You can deploy your app with [ZEIT Now](/docs/v2/introduction) once the domain has been successfully added to your account.

By setting a production domain from your projects' **Domains** dashboard, you will be able to use the following command with [Now CLI](/download):

<Snippet dark text="now --prod" />
<Caption>Deploying with a production domain using Now CLI.</Caption>

This command will deploy your project and make it accessible at the production domain that you have setup.

For more information on production domains, you can read the [custom domains documentation](/docs/v2/custom-domains#deploying-with-your-domain).

## Transferring Out

If you are looking to transfer your domain away from ZEIT Now, you can do so by [emailing support](mailto:support@zeit.co?subject=Domain%20Transfer%20Out) at support@zeit.co with details of the domain you wish to transfer.

<Note type="warning">
  Before requesting a domain transfer, make sure that the domain has been
  registered with ZEIT for at least 60 days.
</Note>

Once your request has been verified by support, you will be provided with an authorization code. Please consult your new providers' documentation for information on how to use the authorization code and the likely speed of the transfer.

export default ({ children }) => <Guide meta={meta}>{children}</Guide>

export const config = {
  amp: 'hybrid'
}
